﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Banner.aspx.cs" Inherits="ElectronicJournal.Admin.Banner" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ApplicationServices %>" 
        SelectCommand="SELECT * FROM banner"
        UpdateCommand="UPDATE banner SET name = @name, width = @width, height = @height, navigateUrl = @navigateUrl, imageUrl = @imageUrl WHERE idFile = @idFile"
        InsertCommand="INSERT INTO banner (name, conten, width, height, navigateUrl, imageUrl) VALUES (@name, NULL, @width, @height, @navigateUrl, @imageUrl)">
        <InsertParameters>
            <asp:Parameter Name="name" Type="String" />
            <asp:Parameter Name="width" Type="Int32" />
            <asp:Parameter Name="height" Type="Int32" />
            <asp:Parameter Name="navigateUrl" Type="String" />
            <asp:Parameter Name="imageUrl" Type="String" />
        </InsertParameters>
    </asp:SqlDataSource>
     <asp:SqlDataSource ID="SqlDataSourceLeftSideBar" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ApplicationServices %>" 
        SelectCommand="SELECT * FROM LeftSidebarBanner"
        UpdateCommand="UPDATE LeftSidebarBanner SET SVew = @SVew, Name = @name, URL = @url WHERE Id_left_sidebar = @Id_left_sidebar"
       InsertCommand="INSERT INTO LeftSidebarBanner (SVew, Name) VALUES (@SVew, @name)">
        <InsertParameters>
            <asp:Parameter Name="SVew" Type="Int32" />
            <asp:Parameter Name="name" Type="String" />
            <asp:Parameter Name="url" Type="String" />
    
        </InsertParameters>
    </asp:SqlDataSource>
<a href="Default.aspx">Меню администратора</a>
<br />
 <table>
    <tbody>
        <tr>
            <td>
                <div  id="UsersRolesPanel">
                    <asp:GridView ID="UsersInRolesGridView" runat="server" 
                    DataSourceID="SqlDataSource1" AutoGenerateColumns="False" CellPadding="1" 
                        CellSpacing="1" DataKeyNames="idFile">
                        <AlternatingRowStyle BackColor="White" />
                        <FooterStyle BackColor="#009999" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#009999" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                        <RowStyle BackColor="#EFF3FB" />
                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                        <SortedAscendingCellStyle BackColor="#F5F7FB" />
                        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                        <SortedDescendingCellStyle BackColor="#E9EBEF" />
                        <SortedDescendingHeaderStyle BackColor="#4870BE" />
                        <Columns>
                            <asp:BoundField DataField="name" SortExpression="name" HeaderText="Название"/>
                            <asp:BoundField DataField="width" SortExpression="width" HeaderText="Ширина"/>
                            <asp:BoundField DataField="height" SortExpression="height" HeaderText="Высота"/>
                            <asp:BoundField DataField="navigateUrl" SortExpression="navigateUrl" HeaderText="URL"/>
                            <asp:BoundField DataField="imageUrl" SortExpression="imageeUrl" HeaderText="Адрес изображения"/>
                            <asp:CommandField ShowEditButton="true" EditText="Изменить" UpdateText="Применить" CancelText="Отмена" />
                        </Columns>
                    </asp:GridView>
				</div>
            </td>
        </tr>
    </tbody>
</table>
<br />
<table>
    <tbody>
        <tr>
            <td>
                Название:
            </td>
            <td>
                <asp:TextBox ID="NameTextBox" runat="server" Width="300px" />
            </td>
        </tr>
        <tr>
            <td>
                Ширина:
            </td>
            <td>
                <asp:TextBox ID="WidthTextBox" runat="server" Width="300px" />
            </td>
        </tr>
        <tr>
            <td>
                Высота:
            </td>
            <td>
                <asp:TextBox ID="HeightTextBox" runat="server" Width="300px" />
            </td>
        </tr>
        <tr>
            <td>
                URL:
            </td>
            <td>
                <asp:TextBox ID="URLTextBox" runat="server" Width="300px" />
            </td>
        </tr>
        <tr>
            <td>
                Адрес изображения:
            </td>
            <td>
                <asp:TextBox ID="ImageTextBox" runat="server" Width="300px" />
            </td>
        </tr>
        <tr>
            <td>
                <asp:Button ID="Button1" runat="server" Text="Добавить" OnClick="AddBanner" />
            </td>
        </tr>
    </tbody>
</table>






<a href="Default.aspx">Меню администратора</a>


<h4>Баннеры левой боковой панели </h4>


 
                  <div  id="Div1">
                    <asp:GridView ID="GridView1" runat="server" 
                    DataSourceID="SqlDataSourceLeftSideBar" AutoGenerateColumns="False" CellPadding="1" 
                        CellSpacing="1" DataKeyNames="Id_left_sidebar">
                     

                        <FooterStyle BackColor="#009999" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#009999" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                        <RowStyle BackColor="#EFF3FB" />
                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                        <SortedAscendingCellStyle BackColor="#F5F7FB" />
                        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                        <SortedDescendingCellStyle BackColor="#E9EBEF" />
                        <SortedDescendingHeaderStyle BackColor="#4870BE" />
                        <Columns>

                            <asp:BoundField DataField="SVew" SortExpression="SVew" HeaderText="Отображать"/>
                            <asp:BoundField DataField="Name" SortExpression="name" HeaderText="Имя файла" />
                            <asp:BoundField DataField="URL" SortExpression="url" HeaderText="URL" />
                            <asp:CommandField ShowEditButton="true" EditText="Изменить" UpdateText="Применить" CancelText="Отмена" />
                        </Columns>
                    </asp:GridView>



        <asp:FileUpload ID="FileUpload1" runat="server"  />
      
    
        <asp:Button id="UploadBtn" 
            Text="Загрузить"
            OnClick="UploadBtn_Click"
            runat="server">
        </asp:Button>    

        <asp:Label id="UploadStatusLabel"
            runat="server">
        </asp:Label>   

        </div>




</asp:Content>
